<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>recgames</title>
<%@ include file="/include/jqueryinclude.jsp" %>
<link rel="stylesheet" type="text/css" href="../style/layout.css" />
<link rel="stylesheet" href="../style/menu_style.css" type="text/css" />
<script type="text/javascript" src="../scripts/clock.js"></script>
</head>
<body onload="updateClock(); setInterval('updateClock()',1000)">
	<%@ include file="/include/header.jsp"%>	
	<div id="mainContainer">
		<div id="mainContent">
			<div id="title">My events</div>
			<c:choose>
				<c:when test="${noEvents }">
					<p>You have no active events! Check out active events <a href="https://localhost:8443/recgames/registered/index.do">here</a></p>
				</c:when>
				<c:otherwise>
					<c:forEach var="event" items="${ events }">
							<div id="eventContainer">
								<a href='showEvent.do?id=${event.getId()}'>${event.getEventName()}<span style="position:absolute; width:100%; height:100%; top:0; left: 0; z-index: 1"></span></a>
								( ${event.getStatus()} )<br/>
								${event.getDescription() } <br/><br/>
								Participants: ${event.getNumberOfSignedUpUsers()} <c:if test='${event.hasMaxCapacity()}'>/${event.getMaxCapacity() }</c:if><br/>
								Starts ${event.getStartTime() }
							</div>
					</c:forEach>
				</c:otherwise>
			</c:choose>
		</div>
		<%@ include file="/include/menu.jsp"%>
	</div>
</body>
</html>